package cn.seocoo.platform.search.service.impl;

import java.util.List;

import cn.seocoo.platform.base.dto.BaseCommonDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.seocoo.platform.search.mapper.SearchRecordMapper;
import cn.seocoo.platform.search.domain.SearchRecord;
import cn.seocoo.platform.search.service.ISearchRecordService;
import cn.seocoo.platform.common.core.text.Convert;

/**
 * 用户搜索记录 服务层实现
 * 
 * @author wujian
 * @date 2019-12-25
 */
@Service
public class SearchRecordServiceImpl implements ISearchRecordService 
{
	@Autowired
	private SearchRecordMapper searchRecordMapper;

	/**
     * 查询用户搜索记录信息
     * 
     * @param id 用户搜索记录ID
     * @return 用户搜索记录信息
     */
    @Override
	public SearchRecord selectSearchRecordById(Integer id)
	{
	    return searchRecordMapper.selectSearchRecordById(id);
	}
	
	/**
     * 查询用户搜索记录列表
     * 
     * @param searchRecord 用户搜索记录信息
     * @return 用户搜索记录集合
     */
	@Override
	public List<SearchRecord> selectSearchRecordList(SearchRecord searchRecord)
	{
	    return searchRecordMapper.selectSearchRecordList(searchRecord);
	}
	
    /**
     * 新增用户搜索记录
     * 
     * @param searchRecord 用户搜索记录信息
     * @return 结果
     */
	@Override
	public int insertSearchRecord(SearchRecord searchRecord)
	{
	    return searchRecordMapper.insertSearchRecord(searchRecord);
	}
	
	/**
     * 修改用户搜索记录
     * 
     * @param searchRecord 用户搜索记录信息
     * @return 结果
     */
	@Override
	public int updateSearchRecord(SearchRecord searchRecord)
	{
	    return searchRecordMapper.updateSearchRecord(searchRecord);
	}

	/**
     * 删除用户搜索记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteSearchRecordByIds(String ids)
	{
		return searchRecordMapper.deleteSearchRecordByIds(Convert.toStrArray(ids));
	}


	@Override
	public List<BaseCommonDto> selectSearchRecordByAppUserId(Integer appUserId) {
		return searchRecordMapper.selectSearchRecordByAppUserId(appUserId);
	}

	@Override
	public void deleteSearchRecordByAppUserId(Integer appUserId) {
		searchRecordMapper.deleteSearchRecordByAppUserId(appUserId);
	}

}
